package com.itheima.修饰符.权限修饰符.Test1;

public class Fu {
    //private:私有权限,仅限本类中访问
    private String name = "德玛西亚";
    //不写权限,表示默认权限,支持同一个包下的类访问
    int age =666;
    //受保护权限,支持同一个包下的类访问及挎包子类
    protected double height = 2.26;
//公共权限,支持任意类访问
    public double weight = 888;

    public void method(){
        System.out.println(age);
        System.out.println(height);
        System.out.println(weight);
        System.out.println(name);
    }
}
    //同包子类
    class Zi extends Fu{
        public void method(){
            //System.out.println(super.name);//name的权限是private,只能在Fu类中访问
            System.out.println(super.height);
            System.out.println(super.weight);
            System.out.println(super.age);
        }
    }

